package com.topc.participant.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.topc.participant.model.po.UserInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
public class UserShowVo {

    private Long id;

    private String username;

    private String name;

    private String avatarUrl;

    private String number;

    private String studentClass;

    @ApiModelProperty(name = "更新时间", notes = "")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    private int status;

    public UserShowVo(UserInfo userInfo) {
        this.id = userInfo.getId();
        this.username = userInfo.getUsername();
        this.avatarUrl =userInfo.getAvatarUrl();
        this.name = userInfo.getName();
        this.number = userInfo.getNumber();
        this.studentClass = userInfo.getStudentClass();
        this.createTime = userInfo.getCreateTime();
        this.status = userInfo.getStatus();
    }
    public UserShowVo() {
    }
}
